#include <iostream>
#include <algorithm>
#include <cstring>

int const maxn = 105;
int const maxd = 22;
int const mo = 1e9 + 7;
long long f[2][maxd][(1<<11) + 4];
char da[maxn][maxn];
int n, m, c, d;

long long calc()
{
	int now = 0, pre = 1;
	std::memset(f[now], 0, sizeof(f[now]));
	f[now][0][(1<<m) - 1] = 1;

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			std::swap(now, pre);
			memset(f[now], 0, sizeof(f[now]));

			for (int k = 0; k <= d; k++) {
				for (int t = 0; t < (1 << m); t++)
					if (da[i][j] == '1') {
						if (t & (1<<j))
							f[now][k+1][t] = (f[now][k+1][t] + f[pre][k][t]) % mo;

						if (j && !(t & (1<<(j-1))) && (t & (1<<j)))
							f[now][k][t | (1<<(j-1))] =
								(f[now][k][t | (1<<(j-1))] + f[pre][k][t]) % mo;

						f[now][k][t ^ (1<<j)] = (f[now][k][t ^ (1<<j)] + f[pre][k][t]) % mo;
					} else
						if (t & (1<<j))
							f[now][k][t] = (f[now][k][t] + f[pre][k][t]) % mo;
			}

		}
	}
	long long ans = 0;
	for (int i = c; i <= d; i++)
		ans = (ans + f[now][i][(1<<m)-1]) % mo;
	return ans;
}

int main()
{
	std::ios::sync_with_stdio(false);
	while (std::cin >> n >> m >> c >> d) {
		for (int i = 0; i < n; i++)
			for (int j = 0; j < m; j++) std::cin >> da[i][j];
		std::cout << calc() << '\n';
	}
}

